'use strict';
 const db = uniCloud.database();
exports.main = async (event, context) => {
  //event为客户端上传的参数
  let post_id=event.post_id;
  const collection = db.collection('posts');
  let res=await collection.where({"post_id":post_id}).get();
  let count=res.data[0].praise_count;
  count=parseInt(count)+1;
  res=await collection.where({"post_id":post_id}).update({
	  praise_count:count
  });
  console.log('event : ' + event)
  //返回数据给客户端
  return {"status":2}
};
